package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ReviewMapper;
import com.ruoyi.system.domain.Review;
import com.ruoyi.system.service.IReviewService;

/**
 * 复盘Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-13
 */
@Service
public class ReviewServiceImpl implements IReviewService
{
    @Autowired
    private ReviewMapper reviewMapper;

    /**
     * 查询复盘
     *
     * @param reviewId 复盘主键
     * @return 复盘
     */
    @Override
    public Review selectReviewByReviewId(Long reviewId)
    {
        return reviewMapper.selectReviewByReviewId(reviewId);
    }

    /**
     * 查询复盘列表
     *
     * @param review 复盘
     * @return 复盘
     */
    @Override
    public List<Review> selectReviewList(Review review)
    {
        return reviewMapper.selectReviewList(review);
    }

    /**
     * 新增复盘
     *
     * @param review 复盘
     * @return 结果
     */
    @Override
    public int insertReview(Review review)
    {
        review.setCreateTime(DateUtils.getNowDate());
        return reviewMapper.insertReview(review);
    }

    /**
     * 修改复盘
     *
     * @param review 复盘
     * @return 结果
     */
    @Override
    public int updateReview(Review review)
    {
        review.setUpdateTime(DateUtils.getNowDate());
        return reviewMapper.updateReview(review);
    }

    /**
     * 批量删除复盘
     *
     * @param reviewIds 需要删除的复盘主键
     * @return 结果
     */
    @Override
    public int deleteReviewByReviewIds(Long[] reviewIds)
    {
        return reviewMapper.deleteReviewByReviewIds(reviewIds);
    }

    /**
     * 删除复盘信息
     *
     * @param reviewId 复盘主键
     * @return 结果
     */
    @Override
    public int deleteReviewByReviewId(Long reviewId)
    {
        return reviewMapper.deleteReviewByReviewId(reviewId);
    }
}